New message noarticletext-nopermission that does not include misleading link 'edit...
authorTobias <churchofemacs@users.mediawiki.org>
Mon, 7 Sep 2009 16:21:10 +0000 (16:21 +0000)
committerTobias <churchofemacs@users.mediawiki.org>
Mon, 7 Sep 2009 16:21:10 +0000 (16:21 +0000)
RELEASE-NOTES
includes/Article.php
languages/messages/MessagesEn.php
maintenance/language/messages.inc

index e51332d..58d906b 100644 (file)
@@ -467,6 +467,8 @@ this. Was used when mwEmbed was going to be an extension.
   argument
 * (bug 20136) Protection form JavaScript now synchronizes the expiry boxes on
   any change, in addition to onkeyup.
+* Don't link to "edit this page" on MediaWiki:Noarticletext if user is not allowed
+  to create page. Done via new message MediaWiki:Noarticletext-nopermission
 
 == API changes in 1.16 ==
 
index 8f6e33d..9e8e370 100644 (file)
@@ -1213,7 +1213,10 @@ class Article {
                        // Use the default message text
                        $text = $this->getContent();
                } else {
-                       $text = wfMsgNoTrans( 'noarticletext' );
+                       if ( $this->mTitle->userCan( 'edit' ) )
+                               $text = wfMsgNoTrans( 'noarticletext' );
+                       else
+                               $text = wfMsgNoTrans( 'noarticletext-nopermission' );
                }
                $text = "<div class='noarticletext'>\n$text\n</div>";
                if( !$this->hasViewableContent() ) {
index c5b8daf..9a9638e 100644 (file)
@@ -1247,6 +1247,9 @@ If you are an anonymous user and feel that irrelevant comments have been directe
 You can [[Special:Search/{{PAGENAME}}|search for this page title]] in other pages,
 <span class="plainlinks">[{{fullurl:Special:Log|page={{urlencode:{{FULLPAGENAME}}}}}} search the related logs],
 or [{{fullurl:{{FULLPAGENAME}}|action=edit}} edit this page]</span>.',
+'noarticletext-nopermission'       => 'There is currently no text in this page.
+You can [[Special:Search/{{PAGENAME}}|search for this page title]] in other pages,
+or <span class="plainlinks">[{{fullurl:Special:Log|page={{urlencode:{{FULLPAGENAME}}}}}} search the related logs]</span>.',
 'noarticletextanon'                => '{{int:noarticletext}}', # do not translate or duplicate this message to other languages
 'userpage-userdoesnotexist'        => 'User account "$1" is not registered.
 Please check if you want to create/edit this page.',
index 4b8f47e..80136c0 100644 (file)
@@ -537,6 +537,7 @@ $wgMessageStructure = array(
                'talkpagetext',
                'anontalkpagetext',
                'noarticletext',
+               'noarticletext-nopermission',
                'noarticletextanon',
                'userpage-userdoesnotexist',
                'clearyourcache',